package com.yyg.wiki.service;

import com.yyg.wiki.websocket.WebSocketServer;
import org.slf4j.MDC;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * ClassName: WsService
 * Description:
 * date: 2021/8/10 10:05
 *
 * @author 17878
 * @since JDK 1.8
 */
@Service
public class WsService {
    @Resource
    public WebSocketServer webSocketServer;
    @Async
    public void sendInfo(String message,String logId){
        MDC.put("LOG_ID",logId);
        webSocketServer.sendInfo(message);
    }
}
